package com.bibo.controller;

import com.bibo.dao.UserMapper;
import com.bibo.pojo.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class Demo {

    @Autowired
    private UserMapper userMapper;

    @GetMapping("/demo")
    public String getGuanzhuContext(){
        return "hello,this server data";
    }


    @GetMapping("/getUser")
    public User getUser(){
        return userMapper.getUser();
    }

    @GetMapping("/updateUserAge")
    public String updateUserAge(int age){
        int i = userMapper.updateUserAge(age);
        return "修改成功数量：" + i;
    }
}
